<!-- inc:header -->
<div class="notice"><div class="p">
	<table width="100%" cellpadding="0" cellspacing="0">
	<tr>
		<td><span class="lead">&nbsp;&raquo; <a href="{:site_url('user')}">经纪人管理</a> &raquo; 添加/编辑信息</span></td>
	</tr>
	</table>
</div></div>

<form method="post" action="{:site_url('user,setok')}id={:$id}" onsubmit="return to_submit();">
<div class="table">
	<div class="left"><span class="red">*</span> 经纪人组别：</div>
	<select name="groupid" id="groupid" onchange="direct('{:site_url('user,set')}id={:$id}&groupid='+this.value);">
		<!-- $grouplist AS $key=>$value -->
		<option value="{:$value[id]}"{if($value[id] == $groupid)} selected{end}>{:$value[title]}<!-- if($value[group_type] == "guest") -->【游客组】<!-- end --></option>
		<!-- end -->
	</select>
	<span class="clue_on"> 注意，不要选择游客组，游客组仅限来访者权限</span>
</div>


<div class="table">
	<div class="left"><span class="red">*</span> 姓名：</div>
	<input type="text" name="username" id="username" value="{:$rs[username]}" />
</div>

<input type="hidden" name="thumb_id" id="thumb_id" value="{:$rs[thumb_id]}">
<div class="table">
	<div class="left">
		<div style="padding-bottom:3px;">会员头像：</div>
		<div style="padding-bottom:3px;"><input type="button" class="btn2" value="选择" onclick="phpjs_img('thumb_id','thumb_view');" /> &nbsp;</div>
		<input type="button" value="删除" class="btn2" onclick="phpjs_clear_img('thumb_id','thumb_view')" /> &nbsp;
	</div>
	<table cellpadding="0" cellspacing="0">
	<tr>
		<td align="left" id="thumb_view"><!-- if($rs[picture]) --><img src="{:$rs[picture]}" width="80px" height="80px" border="0" /><!-- else --><img src="images/nopic.gif" border="0" /><!-- end --></td>
	</tr>
	</table>
</div>

<div class="table">
	<div class="left"><!-- if(!$id) --><span class="red">*</span> <!-- end -->密码：</div>
	<input type="text" name="pass" id="pass" value="" />
	<span class="clue_on"> <!-- if($id) -->不修改密码请保留为空<!-- else -->请填写密码<!-- end --></span>
</div>

<div class="table">
	<div class="left"><span class="red">*</span> 手机：</div>
	<input type="text" name="phone" id="phone" value="{:$rs[phone]}" />
</div>
<div class="table">
	<div class="left"><span class="red">*</span> 分享：</div>
	<select id="fxstatus" name="fxstatus" class="select">
        <option value="1"{if($rs[fxstatus]=='1')} selected='selected'{end}>已分享</option>
		<option value="0"{if($rs[fxstatus]=='0')} selected='selected'{end}>未分享</option>
	</select>	
</div>
<div class="table">
	<div class="left"><span class="red">*</span> 身份类型：</div>
	<select id="job" name="job" class="select">
        <option value="GSYG"{if($rs[job]=='GSYG')} selected='selected'{end}>公司员工</option>
		<option value="WXFS"{if($rs[job]=='WXFS')} selected='selected'{end}>大众经纪人</option>
		<option value="ZJGS"{if($rs[job]=='ZJGS')} selected='selected'{end}>中介公司</option>
		<option value="DLGS"{if($rs[job]=='DLGS')} selected='selected'{end}>代理公司</option>
		<option value="HZHB"{if($rs[job]=='HZHB')} selected='selected'{end}>合作伙伴</option> 
	</select>	
</div>
<div class="table">
	<div class="left">公司名称：</div>
	<input type="text" name="company" id="company" value="{:$rs[company]}" />
</div>
<div class="table">
	<div class="left">银行户名：</div>
	<input type="text" name="bankAccount" id="bankAccount" value="{:$rs[bankAccount]}" />
</div>
<div class="table">
	<div class="left">银行卡号：</div>
	<input type="text" name="cardCode" id="cardCode" value="{:$rs[cardCode]}" />
</div>
<div class="table">
	<div class="left">银行名称：</div>
	<input type="text" name="bankName" id="bankName" value="{:$rs[bankName]}" />
</div>
<div class="table">
	<div class="left">注册时间：</div>
	<input type="text" name="regdate" id="regdate" onfocus="show_date('regdate')" value="{:$rs[regdate] ? date('Y-m-d H:i',$rs[regdate]) : date('Y-m-d H:i',$sys_app->system_time)}">
</div>

<div class="table">
	<div class="left">&nbsp;</div>
	<input type="submit" class="btn3" id="_phpok_submit" name="article_submit" value=" 提交 ">
</div>
</form>

<script type="text/javascript">
function to_submit()
{
	var username= getid("username").value;
	if(!username)
	{
		alert("经纪人名不允许为空");
		getid("username").focus();
		return false;
	}
	var phone = getid("phone").value;
	if(!phone)
	{
		alert("电话不允许为空");
		getid("phone").focus();
		return false;
	}
	<!-- if(!$id) -->
	var pass = getid("pass").value;
	if(!pass)
	{
		alert("密码不允许为空");
		getid("pass").focus();
		return false;
	}
	<!-- end -->

	//通过Ajax检测经纪人账号和邮箱是否重复
	var url = "{:site_url('user,chk')}id={:$id}&phone="+EncodeUtf8(phone)+"&usercard="+EncodeUtf8(usercard);
	var msg = get_ajax(url);
	if(!msg) msg = "error: 检测失败";
	if(msg != "ok")
	{
		alert(msg);
		return false;
	}
	getid("_phpok_submit").disabled = true;
}
</script>
<!-- inc:footer -->